package part05_原型模式.p03_深拷贝;

/**
 * @ClassName: ClientClone02
 * @Author: AllenSun
 * @Date: 2019/12/6 20:56
 */
public class ClientClone03 {
    public static void main(String[] args) {
        DeepProtoType p=new DeepProtoType();
        p.name="宋江";
        p.deepCloneableTarget=new DeepCloneableTarget("大牛","小牛");

        //完成深拷贝
        DeepProtoType p2=(DeepProtoType) p.deepClone();
        System.out.println("p.name="+p.name+",p.deepCloneableTarget+"+p.deepCloneableTarget.hashCode());
        System.out.println("p2.name="+p2.name+",p2.deepCloneableTarget+"+p2.deepCloneableTarget.hashCode());
    }
}
